normal: Remove variables hooks on module unload
authorB Horn <b@horn.uk>
Fri, 1 Nov 2024 23:46:55 +0000 (23:46 +0000)
committerMiao Wang <shankerwangmiao@gmail.com>
Sun, 15 Feb 2026 13:50:20 +0000 (13:50 +0000)
commit6cd45687fe9e756b9903e38b75167fce319dd7fe
treeb4b77f85cbd8f532f51ff3ea3193b4179920527b
parent68bf5b14204fdb19f6d29d2fc19b9ff4ee8b90f1
normal: Remove variables hooks on module unload

The normal module does not entirely cleanup after itself in
its GRUB_MOD_FINI() leaving a few variables hooks in place.
It is not possible to unload normal module now but fix the
issues for completeness.

On the occasion replace 0s with NULLs for "pager" variable
hooks unregister.

Fixes: CVE-2025-0622
Reported-by: B Horn <b@horn.uk>
Signed-off-by: B Horn <b@horn.uk>
Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com>
Gbp-Pq: Topic cve-2025-jan
Gbp-Pq: Name normal-Remove-variables-hooks-on-module-unload.patch
grub-core/normal/main.c